package install.ren.exercise.test.thread;

import java.util.Set;
import java.util.concurrent.TransferQueue;

public class Producer<T> {

    private TransferQueue<T> transferQueue;

    public void put(T o){
        if(o != null){
                try {
                    System.out.println("begin to producer...");
                    transferQueue.transfer(o);
                    System.out.println("producer ok is :" + o);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
        }

    }

    public void setTransferQueue(TransferQueue transferQueue){
        this.transferQueue = transferQueue;
    }

}
